#include <iostream>
#include <algorithm>
using namespace std;

void reverse(char* str) {
	int size = 0;
	while(*str) {
		size++;
		str++;
	}
	str -= size;
	for(int i = 0; i < size/2; ++i) swap(str[i], str[size - i - 1]);
}

int main() {
    char str[] = "lorem ipsum";
    cout << str << endl;
    reverse(str);
    cout << str << endl;
    return 0;
}
